/** \file
* Declaration of the main application class.
* This file is part of Chorus, available at
* http://code.google.com/p/chorus-twitter/ . This file and all associated files
* and derivative works are bound by the terms of the LGPL 3.0 license,
* available at http://www.gnu.org/licenses/lgpl-3.0-standalone.html .
* \par Subversion URL:
* \$URL: http://chorus-twitter.googlecode.com/svn/branches/cpp/src/app/ChorusApp.hpp $
* \version \$Rev: 152 $
* \date    \$Date: 2010-04-06 07:35:13 +0000 (Tue, 06 Apr 2010) $
*/

#pragma once

#include "system/CurlGlob.hpp"

#include "twitter/DMTree.hpp"
#include "twitter/StatusTree.hpp"
#include "twitter/UserTree.hpp"

/// The main application class.
class ChorusApp
{
public:
	/// The constructor.
	ChorusApp();
	/// The destructor.
	~ChorusApp();

public:
	/// Perform the initial data load. Asynchronous, so returns immediately.
	/// \return True for success.
	bool load();

	/// Update the database. Asynchronous, so returns immediately.
	/// \return True for success.
	bool update();

	/// Save the database. Asynchronous, so returns immediately.
	/// \return True for success.
	bool save();

private:
	/// The status database.
	StatusTree *statuses;
	/// The user database.
	UserTree *users;
	/// The direct message database.
	DMTree *dms;
	/// The curl globals.
	CurlGlob *curlglob;
};
